package org.aplombh.java.utils.multiThread.juc.pool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPool {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        executorService.execute(new Eat());
        executorService.execute(new Eat());
        executorService.execute(new Eat());
        executorService.execute(new Eat());
        executorService.shutdown();
    }
}

class Eat implements Runnable {

    @Override
    public void run() {
            System.out.println(Thread.currentThread().getName() + "eating the food.");
    }
}